package com.why.zing.payapi.scheduled;

import com.why.zing.payapi.service.OrderService;
import com.why.zing.payapi.task.TaskManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 同步支付单状态
 *
 * @author 睁眼看世界
 * @date 2020年2月26日
 */
@Component
public class UpdatePayOrderStatusTask {

    @Autowired
    private OrderService orderService;


    @Scheduled(cron = "*/2 * * * * *")
    public void syncOrderStatus() {
        TaskManager.doTask(() -> orderService.syncOrderStatus(), "同步更新支付单状态");
    }

}
